package com.work.keep.refresh;


import android.view.View;

/**
 * Created by dllo on 16/1/17.
 */
public interface LayoutRefreshableAndLoadable<T extends View> {
    /**
     * 下拉刷新
     */
    void setPullDownRefreshEnabled(boolean pullDownRefreshEnabled);

    //上拉加载
    void setPullUpLoadingEnabled(boolean pullUpLoadingEnabled);

    //滑到底部 是否自动加载更多 会禁用上拉加载功能
    void setAutoLoadingEnabled(boolean autoLoadingEnabled);

    //判断是否已经准备好下拉刷新
    boolean isReadyForRefresh();

    //判断是否已经准备好上拉加载
    boolean isReadyForLoading();

    //判断是否已经准备好自动上拉加载
    boolean isReadyForAutoLoading();

    public void setOnRefreshListener(OnRefreshListener<T> onRefreshListener);

    interface OnRefreshListener<T extends View> {
        void onPullDownToRefresh(PullToRefreshOrLoadBaseLayout<T> pullToRefreshOrLoadBaseLayout);

        void onPullUpToLoading(PullToRefreshOrLoadBaseLayout<T> pullToRefreshOrLoadBaseLayout);
    }

    //结束下拉刷新
    void refreshComplete();

    //结束上拉加载
    void loadingComplete();

    //获取刷新布局
    StateLayoutManager getRefreshView();

    //获取加载布局
    StateLayoutManager getLoadingView();

    //设置最后更新时间
    void setLastUpdatadlabel(CharSequence label);
}
